package LuoGu;

import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Scanner;

public class P5461 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = sc.nextInt();
        int len=(int)Math.pow(2,n);
        int[][] arr = new int[len][len];
        for (int i = 0; i < len; i++) {
            for (int j = 0; j < len; j++) {
                arr[i][j]=1;
            }
        }
        translate(arr,0,arr.length-1,0,arr[0].length-1);
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[0].length; j++) {
                pw.print(arr[i][j]+" ");
            }
            pw.println();
        }
        pw.flush();
    }
    public static void translate(int[][]Arr,int i1,int i2,int j1,int j2){
        if(i1-i2==0||j1-j2==0){
            return;
        }

        turn0(Arr,i1,(i1+i2)/2,j1,(j1+j2)/2);
        translate(Arr,(i1+i2)/2+1,i2,j1,(j1+j2)/2);
        translate(Arr,i1,(i1+i2)/2,(j1+j2)/2+1,j2);
        translate(Arr,(i1+i2)/2+1,i2,(j2+j1)/2+1,j2);

    }
    public static void turn0(int[][] arr,int i1,int i2,int j1,int j2){
        for(int i=i1;i<=i2;i++){
            for(int j=j1;j<=j2;j++){
                arr[i][j]=0;
            }
        }
    }
}
